package com.order.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.order.dao.IContactDao;
import com.order.dao.ICustomerDao;
import com.order.dao.jdbcDao;
import com.order.domain.Contact;
import com.order.service.IContactService;

/**
 * 今日联系的业务层实现类
 * 
 * @author zhy
 *
 */
@Service("contactService")
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class ContactServiceImpl implements IContactService {

	@Resource(name = "contactDao")
	private IContactDao contactDao;
	
	@Resource(name = "customerDao")
	private ICustomerDao customerDao;
	
	@Resource(name = "jdbcDao")
	private jdbcDao dao;
	
	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void updateContact(Integer countContact) {
		contactDao.update(countContact);
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void updateContact(Contact contact) {
		contactDao.update(contact);		
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void updateContact() {
		contactDao.update();
	}
	
	@Override
	public List<Contact> findById(Integer contactId) {
		return contactDao.find(contactId);	
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void updateContact(String date) {
		contactDao.update(date);
	}
	
	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void updateReduce() {
			contactDao.updateReduce();
	}
}
